<?php
namespace Core;

require_once __Dir__ . '/../../simpletest/autorun.php';

class TestOfAddNewUser extends \UnitTestCase 
{
	/**
	* Check a correct add new user
	*
	* @reference
	*
	* @requirement
	* @requirement
	*/
    function testCorrectAddNewUser() 
	{
		$services = new CoreService();
		$result = $services->addNewUser("Christophe", "Durand", "cdurant@gmail.com");
		
		$this->assertFalse($result->isFailed);
		$this->assertTrue(isset($result->response));
    }
	
	/**
	* Check an invalid add new users by email already exist
	*/
    function testInvalidAddUser() 
	{
		$services = new CoreService();
		$result = $services->addNewUser("toto", "titi", "cdurant@gmail.com");
		
		$this->assertTrue($result->isFailed);
    }
}
?>